const express = require('express');
const app = express();
app.engine('art', require('express-art-template'));
const dateformat = require('dateformat')
const template = require('art-template')
template.defaults.imports.dateformat = dateformat;
app.get('/', (req, res) => {
    res.render('index.art', {})
})
app.get('/list', (req, res) => {
    res.render('list.art', {
        posts: [
            { title: '第一篇文章的标题', time: 1573653555098 },
            { title: '第二篇文章的标题', time: 1573653555098 },
            { title: '第三篇文章的标题', time: 1573653555098 },
            { title: '第四篇文章的标题', time: 1573653555098 }
        ]
    })
})
app.listen('3000', () => {
    console.log('服务器创建成功，正在监听端口3000')
})